﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Bintje.bintje;

namespace Bintje
{
    public class UserPreferences : RepoObject
    {
        #region Fields

        private byte[] m_avatar;
        private bool m_receiveEmails;
        private long m_created1;
        private long m_modified1;

        #endregion
        
        #region Properties

        public bool ReceiveEmails
        {
            get { return m_receiveEmails; }
            set { m_receiveEmails = value; }
        }

        public byte[] Avatar
        {
            get { return m_avatar; }
            set { m_avatar = value; }
        }

        public long Modified1
        {
            get { return m_modified1; }
            set { m_modified1 = value; }
        }

        public long Created1
        {
            get { return m_created1; }
            set { m_created1 = value; }
        }

        #endregion

        #region ctor

        public UserPreferences(userPreferences preferences)
        {
            m_avatar = preferences.avatar;
            m_id = preferences.id;
            m_receiveEmails = preferences.receiveEmails;
        } 

        #endregion

        #region Methods

        internal userPreferences ConvertToAPI()
        {
            userPreferences preferences = new userPreferences();
            preferences.avatar = m_avatar;
            preferences.created = m_created1;
            preferences.created1 = m_created1;
            preferences.id = m_id;
            preferences.id1 = m_id;
            preferences.modified = m_modified1;
            preferences.modified1 = m_modified1;
            preferences.receiveEmails = m_receiveEmails;
            return preferences;
        } 

        #endregion
    }
}
